<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/tz_update/'.$cateid)?>">

	<h3>坦桑尼亚申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td>Type of visa requested（签证种类）</td>
            <td colspan="4"><input type="radio" name="visa_type" value="1" <?= (@$info->visa_type==1)?'checked':''?>/>
              Travel visa（旅行签证）&nbsp;&nbsp;
              <input type="radio" name="visa_type" value="2" <?= (@$info->visa_type==2)?'checked':''?>/>
              Transit visa（过境签证）</td>
        </tr>
        <tr class="even">
            <td>Surname （姓）</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>First name（名）</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
        </tr>
        <tr class="odd">
            <td>Maiden name（曾用名）</td>
            <td><input type="text" name="maidenname" value="<?= @$info->maidenname?>" /></td>
            <td>&nbsp;</td>
            <td>Date of birth（出生日期）</td>
            <td><input type="text" name="birth" value="<?= @$info->birth?>" id="birth" /></td>
        </tr>
        <tr class="even">
            <td>Sex (性别)</td>
            <td colspan="4"><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />
              Male （ 男
                ）
                <input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />
              Female （ 女 ）</td>
        </tr>
        <tr class="odd">
            <td>Purpose of visit （旅行目的）</td>
            <td colspan="4">
			  
			    <input type="radio" name="purpose" value="1" <?= (@$info->purpose==1)?'checked':''?>/>
			    Leisure, holiday （旅游）&nbsp;&nbsp;
			    <input type="radio" name="purpose" value="2" <?= (@$info->purpose==2)?'checked':''?>/>
			    Other business （商务）&nbsp;&nbsp;
			    <input type="radio" name="purpose" value="3" <?= (@$info->purpose==3)?'checked':''?>/>
			    Various （其它）&nbsp;&nbsp; <br/>
			    <input type="radio" name="purpose" value="4" <?= (@$info->purpose==4)?'checked':''?>/>
			    Visiting friends, relatives（ 探亲访友）
			    <input type="radio" name="purpose" value="5" <?= (@$info->purpose==5)?'checked':''?>/>
			    Study （学习）&nbsp;&nbsp; 
			    <input type="radio" name="purpose" value="6" <?= (@$info->purpose==6)?'checked':''?>/>
			    Diplomatic 外交<br/>
			    <input type="radio" name="purpose" value="7" <?= (@$info->purpose==7)?'checked':''?>/>
			    Mission ( 政府特派 )
			    <input type="radio" name="purpose" value="8" <?= (@$info->purpose==8)?'checked':''?>/>
			    Transit  (过境)
			    <input type="radio" name="purpose" value="9" <?= (@$info->purpose==9)?'checked':''?>/>
		      Official (公务)<br />
			  <input type="radio" name="purpose" value="10" <?= (@$info->purpose==10)?'checked':''?>/>
			  Meeting, Conference  (会议)
			  <input type="radio" name="purpose" value="11" <?= (@$info->purpose==11)?'checked':''?>/>
			  Health Treatment  (   医学治疗)
			  <input type="radio" name="purpose" value="12" <?= (@$info->purpose==12)?'checked':''?>/>
			  Same day visitor (一天停留)</td>
        </tr>
        <tr class="even">
          <td colspan="5">Requested number of entries:	入境次数<br/>
		  (Not for transit visa)非过境签证 
			  <input type="radio" name="entry_num" value="1" <?= (@$info->entry_num==1)?'checked':''?>/>
			  Single 单次&nbsp;&nbsp;
<input type="radio" name="entry_num" value="2" <?= (@$info->entry_num==2)?'checked':''?>/>
Double 两次
<input type="radio" name="entry_num" value="3" <?= (@$info->entry_num==3)?'checked':''?>/>
Multiple 多次<br/>
Requested duration of stay 要求停留时间:<input type="text" name="stay_duration" value="<?= @$info->stay_duration?>" />  days 天 (Max. 90不超过90天)<br />
Passport Number 护照号码 <input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /> </td>
        </tr>
        <tr class="odd">
            <td>Type of passport 护照种类</td>
            <td colspan="4"><input type="radio" name="travel_document_type" value="1" <?= (@$info->travel_document_type==1)?'checked':''?>/>
Ordinary 普通&nbsp;&nbsp;
<input type="radio" name="travel_document_type" value="2" <?= (@$info->travel_document_type==2)?'checked':''?>/>
Diplomatic 外交&nbsp;&nbsp;
<input type="radio" name="travel_document_type" value="3" <?= (@$info->travel_document_type==3)?'checked':''?>/>
Service公务&nbsp;&nbsp; <br />
<input type="radio" name="travel_document_type" value="4" <?= (@$info->travel_document_type==4)?'checked':''?>/>
Other Travel Document (Please specify)其它旅行证件（请说明）&nbsp;
<input type="text" name="travel_document_type_other" value="<?= @$info->travel_document_type_other?>" /></td>
        </tr>
        <tr class="even">
            <td colspan="2">
				Issue on 签发时间	<input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /><br /> 
            	Valid until有效期至<input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /> </td>
			<td>&nbsp;</td>
			<td>Issued at签发地点</td>
			<td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td></td>
        </tr>
        <tr class="odd">
            <td>Place of birth出生地</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
            <td>&nbsp;</td>
            <td>Country of birth 出生国家</td>
            <td><input type="text" name="birth_country" value="<?= @$info->birth_country?>" /></td>
        </tr>
        <tr class="even">
            <td>Present nationality现国籍</td>
            <td><input type="text" name="cur_nationality" value="<?= @$info->cur_nationality?>" /></td>
            <td>&nbsp;</td>
            <td>Nationality at birth出生国籍</td>
            <td><input type="text" name="ori_nationality" value="<?= @$info->ori_nationality?>"/></td>
        </tr>
		<tr class="odd">
            <td>Marital status婚姻状况</td>
            <td colspan="4">
			<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/> Single 单身&nbsp;
			<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/> Married 已婚&nbsp;		
            <input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/> Divorced 离异&nbsp;
            <input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/> Widowed 丧偶</td>
		        </tr>
        <tr class="even">
            <td>Contact address联系地址</td>
            <td><input type="text" name="address" value="<?= @$info->address?>" /></td>
            <td>&nbsp;</td>
            <td>Postal Code邮编</td>
            <td><input type="text" name="postal" value="<?= @$info->postal?>" /></td>
        </tr>		
        <tr class="odd">
            <td>City城市</td>
            <td><input type="text" name="city" value="<?= @$info->city?>" /></td>
            <td>&nbsp;</td>
            <td>Telephone No电话号码</td>
            <td><input type="text" name="tel" value="<?= @$info->tel?>" /></td>
        </tr>
        <tr class="even">
            <td>E-mail address电子邮件地址</td>
            <td><input type="text" name="email" value="<?= @$info->email?>" id="email"/></td>
            <td>&nbsp;</td>
            <td>Current occupation现有职业</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
        </tr>
        <tr class="odd">
             <td>Employer’s address雇主地址</td>
            <td colspan="4"><input name="employer_address" type="text" value="<?= @$info->employer_address?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
            <td>Arrival date(s) in Tanzania到达坦桑日期</td>
            <td><input type="text" name="arrival_date" value="<?= @$info->arrival_date?>" id="arrival_date" /></td>
			<td>&nbsp;</td>
			<td>Departure date(s) from Tanzania离开坦桑时期</td>
			<td><input type="text" name="departure_date" value="<?= @$info->departure_date?>" id="departure_date" /></td>
        </tr>

        <tr class="odd">
            <td>Your physical address while in Tanzania坦桑尼亚联系地址</td>
            <td colspan="4"><input name="physical_address" type="text" value="<?= @$info->physical_address?>" style="width:500px" />
              <br />(Name of hotel(s), tour operator(s), person(s) or organization(s) visited) 如宾馆、旅行社、邀请人或受访机构名称</td>
        </tr>
        <tr class="even">
            <td colspan="5">Budget available for your stay旅行预算: Cash美金现钞 ＄
              <input type="text" name="budget" value="<?= @$info->budget?>" /> 
              <input type="radio" name="budget_type" value="1" <?= (@$info->budget_type==1)?'checked':''?>/>Credit card信用卡&nbsp;&nbsp;
			  <input type="radio" name="budget_type" value="2" <?= (@$info->budget_type==2)?'checked':''?>/>Travelers cheques旅行支票
			  </td>
        </tr>
        <tr class="odd">
            <td colspan="5">Minors traveling in applicants’ passport同本护照携行儿童<br/>
			Name(s)姓名  <input type="text" name="child1_name" value="<?= @$info->child1_name?>" /> Sex性别 <input type="text" name="child1_sex" value="<?= @$info->child1_sex?>" /> Year of birth出生日期 <input type="text" name="child1_birth" value="<?= @$info->child1_birth?>" id="child1_birth" /><br/>
			Name(s)姓名  <input type="text" name="child2_name" value="<?= @$info->child2_name?>" /> Sex性别 <input type="text" name="child2_sex" value="<?= @$info->child2_sex?>" /> Year of birth出生日期 <input type="text" name="child2_birth" value="<?= @$info->child2_birth?>" id="child2_birth" /><br/>
			Name(s)姓名  <input type="text" name="child3_name" value="<?= @$info->child3_name?>" /> Sex性别 <input type="text" name="child3_sex" value="<?= @$info->child3_sex?>" /> Year of birth出生日期 <input type="text" name="child3_birth" value="<?= @$info->child3_birth?>" id="child3_birth" /><br/>
			</td>
        </tr>
        <tr class="even">
            <td>In case of transit: Do you have an entry permit for the final country of destinations? <br />
              过境签证情况：是否持有目的地国家入境签证？</td>
            <td colspan="4">
			<input type="radio" name="has_final_permit" value="0" <?= (@$info->has_final_permit==0)?'checked':''?>/> No / 没有 <br />
			<input type="radio" name="has_final_permit" value="1" <?= (@$info->has_final_permit==1)?'checked':''?>/>
			 Yes, valid until:有截止至
			 <input type="text" name="final_permit_date" value="<?= @$info->final_permit_date?>" id="final_permit_date"/></td>
        </tr>
        <tr class="odd">
            <td colspan="5">I hereby declare that the information stated above is true correct: 我宣誓以上披露信息均真实有效<br/>
			Date日期: <input type="text" name="app_date" value="<?= @$info->app_date?>" id="app_date" /> Place申请地点: <input type="text" name="app_place" value="<?= @$info->app_place?>" /> </td>
        </tr>
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		visa_type:"required",
		surname:"required",
		firstname:"required",
		birth:"required",
		sex:"required",
		purpose:"required",
		entry_num:"required",
		travel_document_num:"required",
		travel_document_type:"required",
		travel_document_issue_date:"required",
		travel_document_valid_date:"required",
		travel_document_issue_by:"required",
		cur_nationality:"required",
		marital_status:"required",
		budget:"required",
		budget_type:"required",
		has_final_permit:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'yy/mm/dd',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#birth").datepicker();
	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#arrival_date").datepicker();
	$("#departure_date").datepicker();
	$("#child1_birth").datepicker();
	$("#child2_birth").datepicker();
	$("#child3_birth").datepicker();
	$("#final_permit_date").datepicker();
	$("#app_date").datepicker();
	
	$("#email").autoMail();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>